package com.tech.tool.utils;

import com.tech.tool.constant.RedisConstant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;

import java.util.concurrent.TimeUnit;

public class RedisUtil {

    @Autowired
    private StringRedisTemplate redisTemplate;

    public void set(String key, String value, Integer time) {
        redisTemplate.opsForValue().set(key, value, time, TimeUnit.SECONDS);
    }

//    public void delete(String key, String value) {
//        redisTemplate.opsForValue().getOperations().delete(key, value);
//
//    }

}
